package top.yifengxiner.common.exception.base;

/**
 * @author ：baixiao
 * @date ：Created in 2021/5/7 9:57
 * @description：基础异常类
 * @modified By：
 * @version: 0.0.1$
 */
public class BaseException extends RuntimeException
{

    /**
     * 所属模块
     */
    private String module;

    /**
     * 错误码
     */
    private String code;

    /**
     * 错误码对应参数
     */
    private Object[] args;

    /**
     * 错误消息
     */
    private String msg;


    public BaseException(String module,String code,Object[] args,String msg)
    {
        this.module = module;
        this.code = code;
        this.args = args;
        this.msg = msg;
    }

    public BaseException(String module,String code,Object[] args){ this(module,code,args,null);}
    public BaseException(String module,String msg){ this(module,null,null,msg);}
    public BaseException(String code,Object[] args){ this(null,code,args,null);}
    public BaseException(String msg){ this(null,null,null,msg);}

    public String getModule(){ return module; }
    public String getCode(){ return code; }
    public String getMsg(){ return msg; }
    public Object[] getArgs(){ return args; }
}
